import request from '@/utils/request'

// 查询绩效指标列表
export function listPerformance(query) {
  return request({
    url: '/web/performance/list',
    method: 'get',
    params: query
  })
}

// 查询绩效详情
export function getPerformance(perId) {
  return request({
    url: '/web/performance/' + perId,
    method: 'get'
  })
}

// 新增绩效指标
export function addPerformance(data) {
  return request({
    url: '/web/performance/addSave',
    method: 'post',
    data: data
  })
}

// 修改绩效指标
export function updatePerformance(perId, data) {
  return request({
    url: `/web/performance/editSave/${perId}`,
    method: 'put',
    data: data
  })
}
// 删除绩效指标
export function delPerformance(perId) {
  return request({
    url: '/web/performance/' + perId,
    method: 'delete'
  })
}
// 启用绩效指标
export function startPerformance(perId) {
  return request({
    url: '/web/performance/enable/' + perId,
    method: 'post'
  })
}
// 停用绩效指标
export function stopPerformance(perId) {
  return request({
    url: '/web/performance/disContinue/' + perId,
    method: 'post'
  })
}